<?php
echo '<br /><b>Result :</b>';
//Lets calculate the time required.
$time = explode(' ', microtime());
$time = $time[1] + $time[0];
$begintime = $time;
	//User Enabled settings 
	$fgc = 0; // change it to one to enable it
	$debug = 0; // change it to one to enable it.
//Override PHP's standard time limit
set_time_limit(120);
$maxlinks = 300;
//Lets use this as a function to visit the site.	
function curl($link, $post='0')
{
  if($fgc == 1) 
	file_get_contents($link);
  else {
	$ch = curl_init($link);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_COOKIE, 1);
	curl_setopt($ch, CURLOPT_COOKIEJAR, "1");
	curl_setopt($ch, CURLOPT_COOKIEFILE, "1");
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	if($post != '0') {
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
	}
	$page = curl_exec($ch);
	return($page);
	curl_close($ch); }
}

function check($link, $x, $regex, $pattern='', $replace='') {
	if(!empty($pattern)) {
		$link = preg_replace($pattern, $replace, $link);
	}
	if(eregi("http://www.misshacker.com/redirect/?", $link)){
		$link = str_replace("http://www.misshacker.com/redirect/?", "", $link);
	}
	$page = curl($link);
	
		//Get Rapidshare file size
		if(eregi("rapidshare", $link)) {
			preg_match("/<font style\=\"color\:\#8E908F\;\"\>(.*)\<\/font\>/i",$page,$matches);
			$rsSize = "$matches[1]";
		}
		
		//Get Megaupload file size
		if(eregi("megaupload", $link)) {
			preg_match("/<b\>Filesize\:\<\/b\> (.*)\<\/div\>/i",$page,$matches);
			$muSize = "$matches[1]";
			$muSizeKB = $muSize * 1024;
			$rsSize = '| '.$muSizeKB .' KB';
		}
		
		//Get Ziddu file size
		if(eregi("ziddu", $link)) {
			if(preg_match("/<b\>(.*) KB\<\/b\>/i",$page,$matches)){
			$zdSize = "$matches[1]";
			$rsSize = '| '.$zdSize.' KB';
			}
			
			if(preg_match("/<span class\=\"tahoma11\"\>(.*)B\<\/span\>/i",$page,$matches)) {
			$zdSize = "$matches[1]";
			$rsSize = '| '.$zdSize.'B';
			}
		}
			
	$link = htmlentities($link, ENT_QUOTES);
	flush();
	ob_flush();
global $dir, $down;

	if($_POST['d'] && eregi($regex, $page)) {
		echo "<div class=\"g\"><a href=\"$link\"><b>$link</b></a></div>\n";  
	} elseif($_POST['d'] && eregi("The file you are trying to access is temporarily unavailable.", $page)) {
		echo "<div class=\"y\"><a href=\"$link\"><b>$link</b></a></div>\n";
	} elseif($_POST['d'] && !eregi($regex, $page)) {
		echo "<div class=\"r\"><a href=\"$link\"><b>$link</b></a></div>\n";			
	} elseif(!$_POST['d'] && eregi($regex, $page)) {
		echo "<div class=\"g\">$x: Active: <a href=\"$link\"><b>$link</b></a> $rsSize &nbsp;&nbsp;&nbsp;<a href=\"javascript:copy('$link')\" title=\"Copy to your ClipBoard!\">&copy;</a></div>\n";  
	} elseif(!$_POST['d'] &&  !eregi($regex, $page)) {
		echo "<div class=\"r\">$x: Dead: <a href=\"$link\"><b>$link</b></a></div>\n";
	}	
	
} //End function check

function debug() {
if ( !extension_loaded("curl") )
echo "You need to load/activate the cURL extension (http://www.php.net/cURL) or you can set $fgc = 1 in line 16.<br/>";
	else
	echo "cURL is enabled<br/>";
if( PHP_VERSION < 5 ) 
echo "PHP version 5 is recommended although it is not obligatory<br/>";
echo "This will display all of your PHP info on your server<br/>";
echo "Check if your safe mode is turned off as the script cannot work with safe mode on<br/>";
phpinfo();
}
?>

 <?php
if (isset($_POST['links'])) {
$alllinks = @$_POST['links'];
$alllinks = explode(" ", $alllinks);
$alllinks = implode("\n", $alllinks);
$alllinks = explode("\n", $alllinks);
$l = 1;
$x = 1;
if(isset($_REQUEST['debug'])) {
if($debug == 1) 
	debug();
	else
echo "Please change the debug mode to 1";
}

$alllinks = array_unique($alllinks); //removes duplicates
$counta = count($alllinks);
foreach($alllinks as $link) {
	$link = trim($link); 
	if(eregi("^(http)\:\/\/(www\.)?anonym\.to\/\?", $link)){
		$link = explode("?", $link);
		unset($link[0]);
		$link = implode($link, "?");
	}

	if(eregi("^(http)\:\/\/(www\.)?lix\.in\/", $link)){
		$post = 'tiny='.trim(substr(strstr($link, 'n/'), 2)).'&submit=continue';
		preg_match('@name="ifram" src="(.+?)"@i', curl($link, $post), $match);
		$link = $match[1];
	}
   	
	if(eregi("^(http)\:\/\/(www\.)?linkbucks\.com\/link\/" , $link)) {
		$page = curl($link);
		preg_match("/<a href=\"(.+)\" id=\"aSkipLink\">/" , $page , $match);
		$link = $match[1];
	}

	if(eregi("usercash\.com" , $link)) {
		$page = curl($link);
		preg_match("/<TITLE>(.+)<\/TITLE>/" , $page , $match);
		$link = $match[1];
	}  
	
	if(eregi("urlcash\.net" , $link)) {
		$page = @file_get_contents($link);
		$page = strtolower($page);
		
			preg_match_all('/<title>(.*)<\/title>/',$page, $out);	
			$link = substr($out[1][0], 1, -1); //[1] itu utk tampilkan array no 1 , substr utk remove char 1 dan terakhir.
	} 
	 	 
	if(eregi("rapidshare\.com\/users\/" , $link)) {
		$page = curl($link);
		preg_match_all("/<a href=\"(.+)\" target=\"_blank\">/" , $page , $match);
		unset($match[1][0]);
		foreach($match[1] as $link)
		{
			if($l == 1)
			{
				check(trim($link), $x, "You would like to download the following file::" );
				$x++;
			}
		}
	}

if($l == 1) {
	$sites = array(
	array("rapidshare\.com\/files\/", "FILE DOWNLOAD"),
	array("4shared\.com\/file\/", "(Uploaded)|(Last downloaded)"),
	array("uploads\.bizhat\.com\/file\/", "Download Link:"),
	array("megashares\.com\/\?d01=", "Click here to download"),
	array("megaupload\.com/([a-z]{2}\/)?\?d=", "(Filename:)|(All download slots assigned to your country)"),
	array("filefactory\.com\/file\/", "(download link)|(Please try again later)"),
	array("rapidshare\.de\/files\/", "You want to download"),
	array("mediafire\.com\/(download\.php)?\?", "You requested"),
	array("netload\.in\/datei[0-9a-z]{10}\/", "download_load"),	
	array("depositfiles\.com\/([a-z]{2}\/)?files\/", "File Name", "@(com\/files\/)|(com\/[a-z]{2}\/files\/)@i", "com/en/files/"),
	array("sendspace\.com\/file\/", "The download link is located below."),
	array("mihd\.net\/", "Request Download"),
	array("usaupload\.net\/d\/", "Download Link"),
	array("badongo\.com\/([a-z]{2}\/)?(file)|(vid)\/", "(Views)|(Filesize)|(Direct Link)"),
	array("uploading\.com\/files\/", "Download file"),
	array("savefile\.com\/files\/", "link to this file"),
	array("shareonall\.com\/", "File:"),
	array("cocoshare\.cc\/[0-9]+\/", "Filesize:"),
	array("axifile\.com\/?", "You have request", "@com\?@i", "com/?"),
	array("(d\.turboupload\.com\/)|(turboupload.com\/download\/)", "(Please wait while we prepare your file.)|(You have requested the file)"),
	array("files\.to\/get\/", "You requested the following file"),
	array("gigasize\.com\/get\.php\?d=", "Downloaded"),
	array("ziddu\.com\/", "File Size"),
	array("zshare\.net\/(download|audio|video)\/", "Last Download"),
	array("uploaded\.to\/(\?id=|file\/)", "Filename:"),
	array("filefront\.com\/", "http://static4.filefront.com/ffv6/graphics/b_download_still.gif"),
	array("uploadpalace\.com\/[a-zA-Z]{2}\/file\/[0-9]+\/", "Filename:"),
	array("speedyshare\.com\/[0-9]+\.html", "\/data\/"),
	array("momupload\.com\/files\/", "You want to download the file"),
	array("rnbload\.com\/file/" , "Filename:"),
	array("ifolder\.ru\/[0-9]+", "/random/images/"),
	array("adrive\.com\/public\/", "view"),
	array("easy-share\.com" , "file url:"),
	array("bitroad\.net\/download\/[0-9a-z]+\/", "File:"),
	array("megarotic\.com/([a-z]{2}\/)?\?d=", "(Filename:)|(All download slots assigned to your country)"),  
	array("egoshare.\com" , "Filename:"),
	array("megashare\.com\/[0-9]+", "Please Scroll Down and choose how you want to Download Your File")	
	);
	
	foreach($sites as $site) {
		if(eregi($site[0], $link)) {
			check(trim($link), $x, $site[1], $site[2], $site[3]);
			$x++;
		}
	}
	
		if($x > $maxlinks) {
			echo "<p style=\"text-align:center\">Maximum No ($maxlinks) Of links have been reached.</p></body></html>";
			exit();
		}
	}
}
$x--;
$time = explode(" ", microtime());
$time = $time[1] + $time[0];
$endtime = $time;
$totaltime = ($endtime - $begintime);
$plural = ($x == 1) ? "" : "s";

	//Links Counter
	$counter = fopen("counter.txt", "r");
	$total = fread($counter, 1024);
	fclose($counter);
	$total = $total + $x;
	$counter = fopen("counter.txt", "w");
	fwrite($counter, $total);
	fclose($counter);

echo "<p style=\"text-align:center\">$x Link$plural checked in $totaltime seconds.</p>";
}
?>